dict = {}
dict_mt = {__index=dict}

--***************** construction **************
function dict:new()
	local d = {}
	d.word2id = {}
	d.id2word = {}

	setmetatable(d, dict_mt)
	return d
end

--**************** load from file ************
function dict:load( filename )
	local i = 1
	for line in io.lines(filename) do
		self.word2id[line] = i
		self.id2word[i] = line
		i = i + 1
	end
end

--***************** size ****************
function dict:size()
	return #self.id2word
end
